<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * SolicitudDetalle filter form base class.
 *
 * @package    filters
 * @subpackage SolicitudDetalle *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseSolicitudDetalleFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'dia'          => new sfWidgetFormFilterInput(),
      'dinero_dia'   => new sfWidgetFormFilterInput(),
      'bs_ctes'      => new sfWidgetFormFilterInput(),
      'con_anticipo' => new sfWidgetFormFilterInput(),
      'anticipo'     => new sfWidgetFormFilterInput(),
      'id_solicitud' => new sfWidgetFormDoctrineChoice(array('model' => 'Afiliado', 'add_empty' => true)),
      'id_afiliado'  => new sfWidgetFormDoctrineChoice(array('model' => 'Afiliado', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'dia'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'dinero_dia'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bs_ctes'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'con_anticipo' => new sfValidatorPass(array('required' => false)),
      'anticipo'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'id_solicitud' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Afiliado', 'column' => 'id')),
      'id_afiliado'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Afiliado', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('solicitud_detalle_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SolicitudDetalle';
  }

  public function getFields()
  {
    return array(
      'id'           => 'Number',
      'dia'          => 'Number',
      'dinero_dia'   => 'Number',
      'bs_ctes'      => 'Number',
      'con_anticipo' => 'Text',
      'anticipo'     => 'Number',
      'id_solicitud' => 'ForeignKey',
      'id_afiliado'  => 'ForeignKey',
    );
  }
}